<template>
    <div class="modal fade" id="cusCommissionLog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          	<div class="modal-header">
            	<button @click="canel" type="button" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> 
            	<h4 class="modal-title" id="myModalLabel"> 佣金记录</h4>
          	</div>
          	<div class="modal-body">
          	 	<div class="form-horizontal">
					<div class="custom_gj">
                        <div class="cu_gj_con">
                            <div class="cu_gj_pot"></div>
                            <!-- <p>${follow.createTime?string("yyyy-MM-dd HH:mm:ss")}</p> -->
                            <div class="cu_gj_text" v-for="(row, index) in commissionLogs" :key="index">
                                <font>
                                    【{{row.commissionType == 0 ? '开发商佣金': '合作机构佣金'}}】{{row.operationType == 0 ? '编辑佣金': '结算佣金'}}&nbsp;&nbsp; {{row.createUserName}} &nbsp;&nbsp;{{row.createTime}}&nbsp;
                                </font>
                                <font>{{row.commissionType == 0 ? '开发商佣金': '合作机构佣金'}}：{{row.commission}}元</font>
                                <font v-if="row.remark">备注：{{row.remark}}</font>
                                <!-- <b>${follow.createTime?string("yyyy-MM-dd HH:mm:ss")}</b> -->
                                <ul class="clearfix" id="declareIamge" style="margin-top:6px">
                                    <li v-for="(item, index) in row.affixList" :key="index" class="declare-follow-list">
                                        <img width="100px" height="100px" v-img:index :src="item.url" v-if="item.fileType.toLowerCase() =='png'
                                    || item.fileType.toLowerCase() =='jpg'
                                    || item.fileType.toLowerCase() =='jpeg'
                                    || item.fileType.toLowerCase() =='gif'" />
                                        <div width="100%" height="100%" class="pic-bg-fj" v-else></div>
                                        <div class="mask-page" v-if="item.fileType.toLowerCase() !='png'
                                    && item.fileType.toLowerCase() !='jpg'
                                    && item.fileType.toLowerCase() !='jpeg'
                                    && item.fileType.toLowerCase() !='gif'"></div>
                                        <div class="operation-btn" v-if="item.fileType.toLowerCase() !='png'
                                    && item.fileType.toLowerCase() !='jpg'
                                    && item.fileType.toLowerCase() !='jpeg'
                                    && item.fileType.toLowerCase() !='gif'">
                                            <a href="javascript:;" @click="transformationBase(item.url,item.fileType)">下载</a>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
	            </div>
          	</div>
          	<!-- <div class="modal-footer">
            	<button type="button" class="btn checkedBtn" v-show="btnShow" @click="saveCommission">确定</button>
				<button type="button" class="btn btn-default" v-show="btnShow" @click="canel">取消</button>
          	</div> -->
        </div>
      </div>
    </div>
</template>
<script>
	export default{
		//接收父组件的绑定值
		props: ["commissionLog"],
		data() {
			return {
				//机构信息对象
				params: {
                    commissionType: '',
                    id: 0
                },
                commissionLogs: [],
			}
        },
    //    watch: {
	// 		'commissionLog.commissionId': {
	// 			handler: function(val, oldVal){
	// 				if(val){
	// 					//this.initCommissionLog();
	// 					//this.initUnBindPremises();
	// 				}
	// 			},
	// 			//深层监听，当位对象时，若设为true，属性变更时即可触发，若为false，属性无法监听到
	// 			deep: true
	// 		}
    //     },
        mounted() {
            //this.initCommissionLog();
        },
		methods: {
            initCommissionLog: function() {
                const _self = this;
                console.log('++++++'+_self);
                const url = this.utilHelper.apiUrl+'/api/cp/getReportCommissionLog';
                const body = {};
                _self.params.commissionType = this.commissionLog.commissionType;
                _self.params.id = this.commissionLog.commissionId;
				body.params = _self.params;
                _self.$http.post(url,body).then((response) =>{
                   var resData = response.body.resData;
                    _self.commissionLogs = [];
                    if(resData.data && resData.data.length > 0){
                        _self.commissionLogs = resData.data;
                    }
                    console.log('####'+resData.data);
                },(response)=>{
                    layer.msg("获取失败");
                });
			},
			canel:function(){
                $('#cusCommissionLog').modal('hide');
            },
			init(){
                this.params.remark='';
                
			},transformationBase(data, type) {
                
            }
		}
	}
	
</script>